package com.sskj.wallet.presenter;

import com.lzy.okgo.model.Response;
import com.sskj.common.base.HttpData;
import com.sskj.common.util.ToastUtil;
import com.sskj.lib.http.JsonCallBack;
import com.sskj.wallet.bean.CoinListBean;
import com.sskj.wallet.http.HttpConfig;
import com.sskj.wallet.ui.activity.AddCoinActivity;

import java.util.List;


public class AddCoinActivityPresenter extends BasePresenter<AddCoinActivity> {

    public void getData() {
        httpService.getCoinList()
                .execute(new JsonCallBack<HttpData<List<CoinListBean>>>(this) {
                    @Override
                    public void onSuccess(Response<HttpData<List<CoinListBean>>> response) {
                        HttpData<List<CoinListBean>> httpData = response.body();
                        if (httpData.getStatus() == HttpConfig.OK) {
                            mView.updateUI(httpData.getData());
                        }
                    }
                });
    }
}
